import request from "@/utils/request";

/**
 * 根据ID获取漫画信息
 * @param {object} data - { username, password }
 */
export function getCourseDet(data) {
  return request({
    url: `/app/course/selectCourseDetailsById?id=${data}`,
    method: "get",
  });
}

/**
 * 登录
 */
export function getLogin(data) {
  return request({
    url: "/app/Login/anonymousLogin?platform=" + "PWA",
    method: "post",
    data,
  });
}

/**
 * 根据ID获取章
 */
export function getChapter(params) {
  return request({
    url: "/app/course/selectCourseDetailsPage",
    method: "get",
    params: params,
  });
}

/**
 * 获取分类
 */
export function getClassifyType() {
  return request({
    url: "/app/courseClassification/getAllClassification",
    method: "get",
  });
}

/**
 * 获取漫画列表
 */
export function getCommicList(params) {
  return request({
    url: "/app/course/selectCourse",
    method: "get",
    params: params,
  });
}

/**
 * 获取专题漫画列表
 */
export function getSpecialCommicList(params) {
  return request({
    url: "/app/course/topicCategory/pageCourseByTopicId",
    method: "GET",
    params: params,
  });
}

/**
 * 获取我的收藏漫画列表
 */
export function getFavoriteCommicList(params) {
  return request({
    url: "/app/courseCollect/selectByUserId",
    method: "GET",
    params: params,
  });
}
